-
Notifications
You must be signed in to change notification settings - Fork 2.8k
WIP: Syntax highlighting in code block #19813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
@iOvergaard @leekelleher how can I reference/query Or perhaps is can be it can query similar to this (although I couldn't find the id searching the repository): Lines 11 to 12 in fb9a9b3
I think it is possible to register e.g. "Umbraco" as class to be highlighted in Monarch, but anyway it would be great for HTML, CSS, JS, JSON, XML etc. We can probably also use the |
When I formatted the existing element with slotted content, it seems to apply, but with empty content in the wrapping HTML elements. However when I use |
@warrenbuckley since you previously have worked with Monaco editor, perhaps you have some ideas for this? 😊 |
It seems I first needed to call If I call For JSON it may need a bit more configuration. It seems it is also possible to use shiki to customize highlighter further: |
Hi @bjarnef looks good, so feel free to conitnue. We do need to keep rendering performance in mind, so it may be worth investigating if the slottet content/aka. the not colourized content could be kept out of the rendering, and only rendering it once it has been colourized. I would love to help, but for the coming period this is not of highest priority so just notice this will first get attention from me later. But keep up the good work and I'm 100% sure this is something we like to get in, so lets make sure it gets into a good state and can take part in the project :-) |
Prerequisites
Description
Attempt to use monaco API to format code in code block element, e.g. HTML, CSS, JavaScript/TypeScript, C# etc.
#16706
The additional code examples here are just inserted directly in query builder dialog just to test different formats.
chrome_M803a6EGAz.mp4